from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base

# 添加 charset 和其他参数以提高兼容性
engine = create_engine(
    "mysql+pymysql://root:123456@localhost:3306/ai_education_db?charset=utf8mb4",
    echo=True  # 可选：用于调试，可以看到SQL语句
)
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
Base = declarative_base()

